package com.tencent.stat;

import android.content.Context;
import com.tencent.mid.api.MidService;
import com.tencent.mid.util.Util;
import com.tencent.stat.common.StatCommonHelper;
import com.tencent.stat.common.StatLogger;

final class l
  implements Runnable
{
  public final void run()
  {
    NetworkManager.getInstance(StatServiceImpl.e()).registerBroadcast();
    if (Util.isMidValid(MidService.getLocalMidOnly(this.a)))
      MidService.getMid(this.a);
    StatCommonHelper.getDiffTime(this.a, true);
    aw.a(this.a);
    f.b(this.a);
    StatServiceImpl.a(Thread.getDefaultUncaughtExceptionHandler());
    Thread.setDefaultUncaughtExceptionHandler(new ap());
    if (StatConfig.getStatSendStrategy() == StatReportStrategy.APP_LAUNCH)
      StatServiceImpl.commitEvents(this.a, -1);
    if (!(StatConfig.isDebugEnable()))
      return;
    StatServiceImpl.f().d("Init MTA StatService success.");
  }
}